import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/course',
    name: 'Course',
    redirect: '/course/index',
    component: Layout,
    meta: {
      title: '课程管理',
    },
    children: [
      {
        path: 'matching',
        name: 'CourseMatching',
        meta: {
          title: '课程互动',
        },
        component: () => import('@/views/course/matching.vue'),
      },
      {
        path: 'duringClass',
        name: 'CourseDuringClass',
        meta: {
          title: '课程互动-已开课',
        },
        component: () => import('@/views/course/duringClass.vue'),
      },
      {
        path: 'classroomRecord',
        name: 'CourseClassroomRecord',
        meta: {
          title: '课堂记录',
        },
        component: () => import('@/views/course/classroomRecord.vue'),
      },
      {
        path: 'studentRecord',
        name: 'CourseStudentRecord',
        meta: {
          title: '学员记录',
        },
        component: () => import('@/views/course/studentRecord.vue'),
      },
    ],
  },
];

export default routes;
